package com.itgaoshu.hospitalproject.service.impl;

import com.itgaoshu.hospitalproject.bean.Unit;
import com.itgaoshu.hospitalproject.mapper.UnitMapper;
import com.itgaoshu.hospitalproject.service.UnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class UnitServiceImpl implements UnitService {

    @Autowired
    private UnitMapper unitMapper;

    @Override
    public List<Unit> findAllUnit(String unitName) {
        return unitMapper.findAllUnit(unitName);
    }

    @Override
    public int addUnit(Unit unit) {
        return unitMapper.addUnit(unit);
    }

    @Override
    public int count(Unit unit) {
        return unitMapper.count(unit);
    }
}
